<?php
namespace Admin\Controller;
use \Think\Controller;

class ProductController extends Controller{

	public function _initialize(){

		echo "初始化防复发<br>";
	}

	public function index(){

		//$c = new \Admin\Controller\IndexController();
		//$c = A('Index');
		//$c = A('User');
		//$c = A('Home/Index');
		//$c->index();
		//$c->add();
		//R('Index/add');
		//R('Home/Index/add');

		$e = A('User','Event');
		$e->demo();
	}

	public function _before_demo(){
		echo "before<br>";
	}

	public function demo(){
		echo "demo<br>";
	}

	public function _after_demo(){
		echo "after<br>";
	}

	public function test($id = 0,$name = 'yanyan'){
		echo $id,$name;
	}

	public function getUrl(){
		echo U('index')."<br>";
		echo U('User/index')."<br>";
		echo U('Home/User/index')."<br>";
		echo U('Home/User/index?id=1')."<br>";
		echo U('Home/User/index','id=1')."<br>";
		echo U('Home/User/index',array('id'=>1,'name'=>'jack'))."<br>";
		echo U('Home/User/index',array('id'=>1,'name'=>'jack'),'xml')."<br>";
		echo U('Home/User/index#mao',array('id'=>1,'name'=>'jack'),'xml')."<br>";
		echo U('Home/User/index#mao@www.lampbrother.net',array('id'=>1,'name'=>'jack'),'xml')."<br>";

	}

	public function getParam(){
		//$name = I('get.name','','htmlspecialchars');
		//$get = I('get.','','htmlspecialchars');
		//$get = I('id');
		//dump($get);
		echo I('get.email','','email');
	}
}